package micro.service;

import micro.data.mapper.UserMapper;
import micro.data.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author txw
 * @version V1.0
 * @Title: UserService
 * @ProjectName micro-user-server
 * @Description: 描述
 * @since 2018/6/19 0:06
 */
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    /**
     * 查询id
     * @param id
     * @return
     */
    public User findByOne(Long id){
        if(id!=null){
            return userMapper.findById(id);
        }
        return null;
    }

    /**
     * 登录
     * @param name
     * @param pwd
     * @return
     */
    public User login(String name,String pwd){
        if(name!=null && pwd!=null){
            return userMapper.login(name,pwd);
        }
        return null;
    }
}
